// Copyright@ChenChao


#include "Character/AuraCharacterBase.h"

#include "GameFramework/CharacterMovementComponent.h"

// 设置默认值
AAuraCharacterBase::AAuraCharacterBase()
{
 	// 将此字符设置为每帧调用Tick（）。如果你不需要它，你可以关闭它来提高性能。
	PrimaryActorTick.bCanEverTick = false;

	Weapon=CreateDefaultSubobject<USkeletalMeshComponent>("Weapon");
	//安装附件
	Weapon -> SetupAttachment(GetMesh(),"WeaponHandSocket");
	//无碰撞
	Weapon -> SetCollisionEnabled(ECollisionEnabled::NoCollision);

	//角色朝向运动方向
	GetCharacterMovement() -> bOrientRotationToMovement = true;								//将旋转方向调整为运动方向
	GetCharacterMovement() -> RotationRate = FRotator(0.f,400.f,0.f);		//旋转速率控制
	GetCharacterMovement() -> bConstrainToPlane = true;										//约束到平面
	GetCharacterMovement() -> bSnapToPlaneAtStart = true;									//角色开始时会被吸附到平面上
	
	//不需要控制器旋转
	bUseControllerRotationPitch = false;
	bUseControllerRotationYaw = false;
	bUseControllerRotationRoll = false;
	
}

// 在游戏开始或生成时调用
void AAuraCharacterBase::BeginPlay()
{
	Super::BeginPlay();
	
}



